#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
    freopen("case.txt", "r", stdin);
    int n1, n2;
    string str;
    cin >> str;
    n1 = (str.length() + 2) / 3;
    n2 = str.length() + 2 - 2 * n1;
    int i, j;
    for (i = 0; i < n1 - 1; i++)
    {
        j = str.length() - 1 - i;
        printf("%c%*s%c\n", str[i], n2 - 2, "", str[j]);
    }
    for (; i < j; i++)
        printf("%c",str[i]);
    return 0;
}